home *** CD-ROM | disk | FTP | other *** search
/ Mac Magazin/MacEasy 42 / Mac Magazin and MacEasy Magazine CD - Issue 42.iso / Software / Unterhaltung / Spiele / TicTacBug ƒ / Read Me next >
Text File  |  1998-01-20  |  8KB  |  79 lines

  1. TicTacBug
  2. version 1.0b1
  3. ©1997 Graham Herrick
  4.  
  5. Contents
  6. • What is TicTacBug
  7. • How not to use TicTacBug
  8. • How to install TicTacBug
  9. • How to use TicTacBug
  10. • How to distribute TicTacBug
  11. • More about TicTacBug
  12. • How to contact the author
  13. • The Rules
  14. • The Usual Legal Stuff
  15.  
  16. What is TicTacBug
  17.     TicTacBug is an entertainment dcmd from Quadratic Software that allows you to play tic-tac-toe from within MacsBug. (It's part of a future GameBug™ family of entertainment dcmds from Quadratic!) If you do a lot of low-level debugging in MacsBug, or even if you've dropped into MacsBug unintentionally, TicTacBug is your friend. TicTacBug can help to relieve some of the stress associated with hours of decrypting PowerPC assembly or doing long traces through obscure trap patches. And if someday you find yourself caught in MacsBug, and you can't get back to the operating system, (egad!) at least you will have the comfort of knowing that you can still be entertained by your Mac.
  18.     TicTacBug doesn't call the toolbox, doesn't move memory, and uses less than 1K of stack space so it is interrupt safe and should be okay to use most of the time (unless you crash MacsBug itself, of course).
  19.     This is a beta version because I just wrote it over the past couple hours. While it seems to work well, and handle everything I throw at it from the command line, I haven't done extensive testing yet.
  20.  
  21. How not to use TicTacBug
  22.     TicTacBug requires MacsBug, a free low-level Macintosh debugger from Apple Computer. If you are not familiar with MacsBug, you probably won't have much fun with TicTacBug. Of course, you are welcome to try it out. Just don't enter any commands unless you know what they do! MacsBug is intended for programmers who understand assembly language and are familiar with programming the MacOS. If you want to try out TicTacBug, get a copy of MacsBug, install it, drop into MacsBug by holding down the command key while pressing the power key, then type "help" into the command line and press return. To go back to the MacOS, enter "g". If you get into MacsBug by crashing, enter "es". If that doesn't work, restart your computer by entering "rs". Also, if you've never used MacsBug before and download it from somewhere, make sure you are using the latest version (especially if you are using MacOS 8).
  23.  
  24. How to install TicTacBug
  25.     Install MacsBug, then put the "TicTacBug" file into the "MacsBug Preferences" folder within the Preferences Folder in your System Folder. The next time you reboot with MacsBug installed, TicTacBug will be installed as well. The TicTacBug file also includes some handy macros to make TicTacBug easier to use. Type "help TicTacBug" to get help on using TicTacBug. Type "mcd ttb" to get a list of the TicTacBug macros.
  26.  
  27. How to use TicTacBug
  28.     Once TicTacBug is installed (see above) you can type "help TicTacBug" in MacsBug to get help with using it. TicTacBug is, of course, a command-line game. It stores a tic-tac-toe board internally. To see this board, type "TicTacBug" without any options. The board is always there, so you can start a game, go do stuff on your computer, and then come back to MacsBug and finish the game.
  29.     To tell TicTacBug to make a move on the board, type "TicTacBug -g". To make a move yourself, type "TicTacBug -m <n>" where <n> is the number of the square to which you want to move. The squares are numbered like this:
  30.  
  31.    |   |
  32.  1 | 2 | 3
  33. ---|---|---
  34.  4 | 5 | 6
  35. ---|---|---
  36.  7 | 8 | 9
  37.    |   |
  38.  
  39.     After making a move (either its move or your move), TicTacBug will display the board again. TicTacBug is always "X" and you are always "O".
  40.     To clear the board and start over before finishing a game, type "TicTacBug -c".
  41.     You can type multiple options on the same line. -c is executed before any other option and -g is executed after any other option, regardless of the order in which they are typed. Thus,
  42. "TicTacBug -g -m 3 -c" will clear the board, then enter your first move in square 3, then tell TicTacBug to make its move. This is the same as typing
  43. "TicTacBug -c -m 3 -g" and
  44. "TicTacBug -c -g -m 3".
  45.     Why does TicTacBug always use the same precedence for options? So that the TicTacBug macros work well. The macros are:
  46.  
  47. Name       Expansion
  48. ttb        TicTacBug
  49. ttbc       ttb -c
  50. ttbg       ttb -g
  51. ttbm       ttb -m
  52. ttbgm      ttb -g -m
  53.  
  54.     So, for example, you can move to square 7 and then tell TicTacBug to make its move by typing "ttbgm 7". This is handy when you're playing TicTacBug a lot. (Believe me, you will be playing this for hours on end!)
  55.     By the way, you may want to make logs of your favorite TicTacBug games.
  56.  
  57. How to distribute TicTacBug
  58.     Far and wide. TicTacBug is freeware. Graham Herrick retains ownership of the copyright but grants you a non-exclusive license to make as many copies as you want and to distribute it online, on CD-ROM, or otherwise, as long as this ReadMe file is included along with it. If you want to see the source code, write to me (see below) and I'll send you a copy. The source code is an MPW file, so if you want to compile it yourself, you'll need MPW as well as the "BuildDCMD" tool.
  59.  
  60. More about TicTacBug
  61.     Basically, the algorithm is very simple. Rather than using hash tables, which would take up too much memory (or would require me to analyze all the rotations and reflections of the board with different pieces which I didn't feel like doing) -- rather than doing any of that I just use a simple recursive minimax algorithm (without alpha-beta cutoffs in this version). It seems to work fine since it can only recurse to a depth of nine. Each board (and some flags) is stored in a single 32-bit number, so the stack usage doesn't get out of hand with the recursion. In fact, the nine boards for the recursion are just stored as nine 32-bit globals. It actually only recurses to a depth of eight since TicTacBug bypasses the recursion and automatically chooses square number one when it goes first, which is what it would do anyway (my one optimization so far).
  62.  
  63. How to contact the author
  64.     I'm Graham Herrick. My company is Quadratic Software. The web site is located at
  65.  
  66. <http://www.quadratic.com/>
  67.  
  68. and my email address is <support@quadratic.com>.
  69.     Let me know what you think of TicTacBug, and if you'd like to see more GameBug™ entertainment dcmds. (Such as CheckersBug or ConnectFourBugs). (Seriously! I might actually try to make these things! They might not be too smart, because I'd want to avoid too much recursion, but they could be more fun than TicTacBug.)
  70.  
  71. The Rules
  72.     Oops! I almost forgot the rules. If you've never played tic-tac-toe, here's the idea: It's a two player game with a 3 x 3 grid of squares. One person is "X" and one person is "O". To start the game, someone puts their mark (X or O) into a square. Then the other person does it. Then the first person again. The goal is to fill three squares in a row, column, or diagonal with your mark. If you can do that you win. (Note: TicTacBug never loses so you should never win). If the board is filled up with no row, column, or diagonal containing one person's mark (three X's or three O's), then the game is a tie. (If you practice, you can tie with TicTacBug).
  73.  
  74. The Usual Legal Stuff
  75.     TICTACBUG ("THE SOFTWARE") IS PROVIDED “AS IS”. USE THE SOFTWARE AT YOUR OWN RISK. GRAHAM HERRICK ("THE AUTHOR") MAKES NO WARRANTIES AS TO PERFORMANCE, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR ANY OTHER WARRANTIES WHETHER EXPRESSED OR IMPLIED. NO ORAL OR WRITTEN COMMUNICATION FROM OR INFORMATION PROVIDED BY THE AUTHOR SHALL CREATE A WARRANTY. UNDER NO CIRCUMSTANCES SHALL THE AUTHOR BE LIABLE FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES RESULTING FROM THE USE, MISUSE, OR INABILITY TO USE THE SOFTWARE, EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. THESE EXCLUSIONS AND LIMITATIONS MAY NOT APPLY IN ALL JURISDICTIONS. YOU MAY HAVE ADDITIONAL RIGHTS AND SOME OF THESE LIMITATIONS MAY NOT APPLY TO YOU.
  76.     In no event shall the Author’s total liability to you for actual damages, from any cause whatsoever and regardless of the form of the action, whether in contract, product liability, tort (including negligence), or otherwise, exceed US $50.
  77.  
  78. MacsBug and MacOS are registered trademarks of Apple Computer, Inc. Quadratic, TicTacBug, and GameBug are trademarks of Graham Herrick.
  79.